<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('POST_TMDATA_TMINTERF列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>外围系统单号：</label>
                                <input type="text" name="ZDOCNO" style="width: 130px;"/>
                            </li>

                            <li>
                                <label>SAP单据号码：</label>
                                <input type="text" name="ZSAPDOCNO" style="width: 130px;"/>
                            </li>

                            <li>
                                <label>物料号：</label>
                                <input type="text" name="MATNR" style="width: 130px;"/>
                            </li>
                            <li>
                                <label>批号：</label>
                                <input type="text" name="BATCH" style="width: 130px;"/>
                            </li>
                            <li>
                                <label>凭证中的过帐日期：</label>
                                <input type="text" class="time-input" placeholder="请选择凭证中的过帐日期" name="BUDAT"/>
                            </li>
                            <li>
                                <label>状态：</label>
                                <select name="status" style="width: 130px;" th:with="type=${@dict.getType('POST_TMDATA_TMINTERF')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sap:POST_TMDATA_TMINTERF:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="sap:POST_TMDATA_TMINTERF:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sap:POST_TMDATA_TMINTERF:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div id="div" class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('sap:POST_TMDATA_TMINTERF:edit')}]];
        var removeFlag = [[${@permission.hasPermi('sap:POST_TMDATA_TMINTERF:remove')}]];
        var statusDatas = [[${@dict.getType('POST_TMDATA_TMINTERF')}]];
        var prefix = ctx + "POST_TMDATA_TMINTERF/POST_TMDATA_TMINTERF";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                height: $("#div").height() / 1,
                modalName: "POST_TMDATA_TMINTERF",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'mandt',
                    title: '客户端',
                    visible: false
                },
                {
                    field: 'zdocno',
                    title: '外围系统单号'
                },
                {
                    field: 'posnr',
                    title: '行项次号',
                    visible: false
                },
                {
                    field: 'zsapdocno',
                    title: 'SAP单据号码'
                },
                {
                    field: 'zdoctp',
                    title: '单据类型(条码系统接口)',
                    visible: false
                },
                {
                    field: 'zbustp',
                    title: '业务类型(条码系统接口)',
                    visible: false
                },
                {
                    field: 'budat',
                    title: '凭证中的过帐日期'
                },
                {
                    field: 'matnr',
                    title: '物料号'
                },
                {
                    field: 'erfmg',
                    title: '数量'
                },
                {
                    field: 'erfme',
                    title: '条目单位',
                    visible: false
                },
                {
                    field: 'werks',
                    title: '工厂'
                },
                {
                    field: 'zlocI',
                    title: '接收仓'
                },
                {
                    field: 'zlocO',
                    title: '发出仓',
                    visible: false
                },
                {
                    field: 'kostl',
                    title: '成本中心',
                    visible: false
                },
                {
                    field: 'zvbelnI',
                    title: '销售订单号-接收',
                    visible: false
                },
                {
                    field: 'zposnrI',
                    title: '销售订单行-接收',
                    visible: false
                },
                {
                    field: 'zvbelnO',
                    title: '销售订单号-发货',
                    visible: false
                },
                {
                    field: 'zposnrO',
                    title: '销售订单行-发货',
                    visible: false
                },
                {
                    field: 'zoprter',
                    title: '操作员'
                },
                {
                    field: 'zspno1',
                    title: '订舱号码',
                    visible: false
                },
                {
                    field: 'zxhip2',
                    title: '货柜号Container No.',
                    visible: false
                },
                {
                    field: 'zship3',
                    title: '封条号Seal No.',
                    visible: false
                },
                {
                    field: 'zibdat',
                    title: '传入日期',
                    visible: false
                },
                {
                    field: 'zibtim',
                    title: '传入时间',
                    visible: false
                },
                {
                    field: 'zibusr',
                    title: '传入者',
                    visible: false
                },
                {
                    field: 'zpstflg',
                    title: '过帐状态',
                    visible: false
                },
                {
                    field: 'msgtx',
                    title: '备注说明',
                    visible: false
                },
                {
                    field: 'zpster',
                    title: '过帐者',
                    visible: false
                },
                {
                    field: 'zpstdt',
                    title: '过帐执行日期',
                    visible: false
                },
                {
                    field: 'zpsttm',
                    title: '过帐执行时间'
                },
                {
                    field: 'batch',
                    title: '批号'
                },
                {
                    field: 'status',
                    title: '状态',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(statusDatas, value);
                    }

                },{
                        field: 'error',
                        title: 'SAP返回消息'
                    },
                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.MANDT + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.MANDT + '\')"><i class="fa fa-remove"></i>删除</a>');
                //         return actions.join('');
                //     }
                // }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>